import React, { Component } from 'react'
import styles from "../assets/styles/model.module.css"

export default class Model extends Component {
    render() {
        const { visible,closeModel } = this.props
        if (visible) {
            return (
                // 整个大盒子，设置透明背景
                <div className={styles.modelOption}>
                    {/* 弹框要显示出来区域 */}
                    <div className={styles.modelContent}>
                        <h3>添加优惠券</h3>
                        {/* 放弹框需要表单 */}
                        {/* <input type="text" placeholder='请输入优惠券名字' /> */}
                        {this.props.children}
                        {/*  */}
                        <button onClick={()=>closeModel()}>关闭</button>
                    </div>
                </div>
            )
        }else{
            return null
        }

    }
}
